import {
  EventRecommendationShape,
  PhysicalItemRecommendationShape,
  TabSectionData,
} from "../shared/entityShapes";
import { detailsType } from "../shared/details";
import { ImageStringFormat } from "../shared/mediaTypes";

type BaseShopItemShape = {
  id: number;
  cover: string;
  name: string;
  price: string;
};

export type ShopItemTypes = "giftcertificate" | "souvenir" | "publication";

export type ShopDataShape = {
  [key in ShopItemTypes]: BaseShopItemShape[];
};

export enum ApiShopItemsMapping {
  Souvenir = 0,
  Publication = 1,
  Giftcertificate = 2,
}

export type ShopConfigurationShape = {
  id: number;
  productId: number;
  suk: "default" | string;
  stock: number;
  price: string;
  image: string;
};
export interface ShopItemShape extends detailsType {
  status: boolean;
  type: ApiShopItemsMapping;
  shopId: number;
  cover: string;
  sharePoster: string;
  carouselMap: ImageStringFormat[];
  typeLabelColor: string;
  typeName: string;
  name: string;
  price: string;
  introduction: string;
  availability: number;
  tabInfo: {
    id: number;
    productId: number;
    details: TabSectionData;
  };
  isCollection?: Boolean;
  isDeleted?: number;
  shopAttrs: {
    id: number;
    productId: number;
    attrName: string;
    attrValues: "default" | string; // Explicit: default or any string
  }[];
  shopValue: {
    [key: "default" | string]: ShopConfigurationShape;
  };

  eventRecommendations?: EventRecommendationShape[];
  shopRecommendations?: PhysicalItemRecommendationShape[];
}
